package com.ruoyi.service.impl;

import java.util.List;

import com.ruoyi.app.vo.MemberCarVo;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.mapper.MemberCarMapper;
import com.ruoyi.domain.MemberCar;
import com.ruoyi.service.IMemberCarService;

/**
 * 会员车辆Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-11-11
 */
@Service
public class MemberCarServiceImpl implements IMemberCarService 
{
    @Autowired
    private MemberCarMapper memberCarMapper;

    /**
     * 查询会员车辆
     * 
     * @param id 会员车辆主键
     * @return 会员车辆
     */
    @Override
    public MemberCar selectMemberCarById(Long id)
    {
        return memberCarMapper.selectMemberCarById(id);
    }

    /**
     * 查询会员车辆列表
     * 
     * @param memberCar 会员车辆
     * @return 会员车辆
     */
    @Override
    public List<MemberCar> selectMemberCarList(MemberCar memberCar)
    {
        return memberCarMapper.selectMemberCarList(memberCar);
    }
    /**
     * 查询已认证的会员车辆列表
     *
     * @param memberCar 会员车辆
     * @return 会员车辆
     */
    @Override
    public List<MemberCar> selectMemberCarListByMemberIdAndVin(MemberCar memberCar)
    {
        return memberCarMapper.selectMemberCarListByMemberIdAndVin(memberCar);
    }


    @Override
    public List<MemberCarVo> selectMemberCarListByMemberId(Long memberId)
    {
        List<MemberCarVo> list = memberCarMapper.selectMemberCarListByMemberId(memberId);
        return list;
    }

    /**
     * 新增会员车辆
     * 
     * @param memberCar 会员车辆
     * @return 结果
     */
    @Override
    public int insertMemberCar(MemberCar memberCar)
    {
        memberCar.setCreateTime(DateUtils.getNowDate());
        return memberCarMapper.insertMemberCar(memberCar);
    }

    /**
     * 修改会员车辆
     * 
     * @param memberCar 会员车辆
     * @return 结果
     */
    @Override
    public int updateMemberCar(MemberCar memberCar)
    {
        memberCar.setUpdateTime(DateUtils.getNowDate());
        return memberCarMapper.updateMemberCar(memberCar);
    }

    /**
     * 批量删除会员车辆
     * 
     * @param ids 需要删除的会员车辆主键
     * @return 结果
     */
    @Override
    public int deleteMemberCarByIds(Long[] ids)
    {
        return memberCarMapper.deleteMemberCarByIds(ids);
    }

    /**
     * 删除会员车辆信息
     * 
     * @param id 会员车辆主键
     * @return 结果
     */
    @Override
    public int deleteMemberCarById(Long id)
    {
        return memberCarMapper.deleteMemberCarById(id);
    }
}
